package com.tuyrt.as.proj.main;

import android.content.Context;

import androidx.multidex.MultiDex;
import androidx.multidex.MultiDexApplication;

import com.alibaba.android.arouter.launcher.ARouter;
import com.tencent.bugly.Bugly;
import com.tencent.bugly.beta.Beta;
import com.tuyrt.as.proj.common.ui.component.HiBaseApplication;

/**
 * author: Administrator on 2021/4/29.
 * desc:
 */
public class HiApplication extends HiBaseApplication {
    @Override
    public void onCreate() {
        super.onCreate();

        initArouter();
        initBugly();
    }

    private void initBugly() {
        Bugly.init(this, "e0ab4e1aac", true);
        // true：安装此App的设备都上报为开发测试机
        Bugly.setIsDevelopmentDevice(this,true);
    }

    private void initArouter() {
        if (BuildConfig.DEBUG) {
            ARouter.openLog();
            ARouter.openDebug();
        }

        ARouter.init(this);
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(base);
        // 安装tinker
        Beta.installTinker();
    }
}
